

<template>
  <el-dialog
      v-model="dialogVisible"
      title="科目进度"
      :close-on-click-modal="false"
      width="80%"
  >
    <div>
      <el-table
          :data="tableData"
          border
          default-expand-all
          row-key="subjectCode"
          :tree-props="{ children: 'children' }"
      >
<!--        <el-table-column prop="subjectCode" label="科目代码" />-->
        <el-table-column prop="subjectName" label="科目名称" />
        <el-table-column prop="subjectFee" label="科目费用" />
        <el-table-column prop="payoutFee" label="已支出费用" />
        <el-table-column
            label="执行率"
            sortable
        >
          <template #default="{ row }">
            <el-progress :percentage="row.executeRate!== null? parseFloat(row.executeRate.replace('%', '')) : 0"></el-progress>
            <!--          <span>{{ row.executeRate }}</span>-->
          </template>
        </el-table-column>
<!--        <el-table-column prop="executeRate" label="执行率" />-->
      </el-table>
    </div>
  </el-dialog>

</template>

<script setup lang="ts">

const count = ref(0)
import {
  budgetlist
} from '../../../api/money/zxjdApi'
const dialogVisible = ref(false)
//请求列表
const openDialogKMJD = function (row) {
  dialogVisible.value = true
  console.log(row)
  console.log(row.value)
  // 复制一份 getListParme 对象，避免修改原始数据
  const requestData = { ...row };
  // 将 unitld 从数组转换为字符串
  if (Array.isArray(requestData.projectTypeCode)) {
    // requestData.projectTypeCode = requestData.projectTypeCode.join(',');//项目分类
    // requestData.executeYear = requestData.executeYear.join(',');//执行周期
  }
  console.log(requestData)
  budgetlist({
    // pageNum:1,
    // pageSize:10,
    ...row
  }).then((res)=>{
    tableData.value = res.data

  })

}
const tableData = ref([]);
defineExpose({
  openDialogKMJD,
});
</script>

<style scoped lang="scss">


</style>